Properly cancel threads that execute tests before closing the terminal#132
Merged
pedjaradenkovic merged 4 commits intomainfrom Mar 25, 2026
Merged
Properly cancel threads that execute tests before closing the terminal#132pedjaradenkovic merged 4 commits intomainfrom
pedjaradenkovic merged 4 commits intomainfrom
Conversation
4c7dbb3 to
13f432f
Compare
Collaborator
|
Looks good! I just added a small fix by switching the ordering of the following: The problem was that if you call proc.stdout.read before _kil_process it might wait for EOF which can mess with the test script timeout. You can test this by using your example slow_test.sh script. Run it with "--test-script-timeout 5" and see that it will run for 60 seconds waiting for the sleep to finish. |
VitjanZ
approved these changes
Mar 17, 2026
Collaborator
VitjanZ
left a comment
There was a problem hiding this comment.
Please review the small fix I added otherwise this seems good to me.
101a8eb to
e358d5d
Compare
…xit indefinitely if children hold pipe
ab2e447 to
8398777
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In #124 the problem with quitting the terminal is solved.
Nevertheless, it was noticed when developing scraping software with playwright tests that are executed for a long time, the tests that are run are not canceled. This caused that even computer was completely blocked with a couple of runs.
This implementation also handles sigterm properly in headless mode.
How to test this:
Create slow running script test:
and chmod +x slow_test.sh
and reference it from config file. Run the rendering and exit when running unit test script (ctrl +d)
On main:
grep -af slow_test should return PID
On this branch:
Note: When canceling the render, there are other actions that might not be terminated properly - REST API calls, writing files or git commits. But we actually don't care of them as we are restarting only from certain git check points.